# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mycroft-gui
# It's not actually 1.0.2 but the last few tags have had no proper version numbers in them
# We're honestly just guessing here
pkgver=1.0.2
pkgrel=0
pkgdesc="The Graphical User Interface used by the Mycroft Mark II and more"
url="https://mycroft.ai"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine -> qt5-qtwebview
# armv7: tests segfault
arch="all !armhf !ppc64le !s390x !riscv64 !armv7"
license="Apache-2.0"
depends="kirigami2"
makedepends="
	extra-cmake-modules
	kdbusaddons5-dev
	kio5-dev
	plasma-framework5-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtmultimedia-dev
	qt5-qtwebsockets-dev
	qt5-qtwebview-dev
	samurai
	"
checkdepends="xvfb-run"
source="$pkgname-$pkgver.tar.gz::https://github.com/MycroftAI/mycroft-gui/archive/refs/tags/backports-stable-qt5.tar.gz"
builddir="$srcdir/$pkgname-backports-stable-qt5"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_REMOTE_TTS=OFF
	cmake --build build
}

check() {
	# -j1 to make stresstest work
	xvfb-run ctest --test-dir build --output-on-failure -j1
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
dac1b43d7eb88f7b0b843dce5c8401c092d73de83f25d4489a641d469d771b98cda862b29642fbcc06c11b750aced573ffd267318064470287c42d04f1e78fd5  mycroft-gui-1.0.2.tar.gz
"
